Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: EXPOSED-301 Update with join throws if additionalConstraint provided #2007

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

bog-walk
Copy link
Member

Attempting to use any join function in its full overload form, with an additionalConstraint argument, results in an exception if an update() is called after instead of a select(), for example:

org.jetbrains.exposed.exceptions.ExposedSQLException: No value specified for parameter 2.

This occurs because the additionalConstraint conditions are being correctly appended to generated SQL, but their arguments are not being first registered with the prepared update statement.

The arguments in the update statement now correctly register any additionalConstraint and take into account their order if an update with a WHERE clause is called.

No unit tests existed for the full overload form with update(), so they have been added to existing tests.

…ided

Attempting to use any join function in its full overload form, with an additionalConstraint
argument, results in an exception if an update() is called instead of a select().

This occurs because the additionalConstraint conditions are being correctly appended
to generated SQL, but their arguments are not being first registered with the prepared
update statement.

The arguments in the update statement now correctly register any additionalConstraint
and take into account their order if an update with where is called.
@bog-walk bog-walk requested review from e5l and joc-a February 26, 2024 01:40
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! lgtm

@bog-walk bog-walk merged commit 164a66a into main Feb 26, 2024
5 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-update-with-join branch February 26, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants